HTMLify

index.html
Views: 66 | Author: cody
<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <title>Send Button Animation</title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" />
    <link rel='stylesheet' type='text/css' media='screen' href='style.css'>
</head>

<body>
    <button class="btn">
        <i class="fa-solid fa-plane"></i>
        <span class="text">
            Send Message
        </span>
        <span class="loading-animate"></span>
    </button>

    <script>
        document.querySelector(".btn").addEventListener("click", (evt) => {
            evt.target.classList.add("loading");

            setTimeout(() => {
                evt.target.classList.remove("loading");
            }, 3000);
        });
    </script>
</body>

</html>

Comments